programming4us
           
 
 
Windows

Windows 7 : Getting to the Command Line (part 2) - Running CMD

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
12/5/2010 11:44:29 AM

Running CMD

You can also launch Command Prompt using the CMD executable, which enables you to specify extra switches after the cmd.exe filename. Most of these switches aren’t particularly useful, so let’s start with the simplest syntax that you’ll use most often:

CMD [[/S] [/C | /K] command]
/SStrips out the first and last quotation marks from the command, provided that the first quotation mark is the first character in command
/CExecutes the command and then terminates
/KExecutes the command and remains running
commandThe command to run

For example, if your ISP provides you with a dynamic IP address, you can often solve some connection problems by asking the IP for a fresh address. You do that by running the command ipconfig /renew at the command line. In this case, you don’t need the Command Prompt window to remain open, so you can specify the /CIPCONFIG utility finishes: switch to shut down the command-line session automatically after the

cmd /c ipconfig /renew

On the other hand, you often either want to see the results of the command, or you want to leave the Command Prompt window open so that you can run other commands. In those cases, use the /K switch. For example, the following command runs the SET utility (which displays the current values of the Windows 7 environment variables) and then leaves the command-line session running:

cmd /k set

Here’s the full syntax of cmd.exe:

CMD [/A | /U] [/Q] [/D] [/T:bf] [/E:ON | /E:OFF] [/F:ON | /F:OFF] [/V:ON | /V:OFF] [[/S] [/C | /K] command]


/QTurns command echoing off. If command is a batch file, you won’t see any of the batch file commands as they’re executed. This is the same as adding the statement @ECHO OFF at the beginning of a batch file.
/DDisables the execution of AutoRun commands from the Registry. These commands run automatically when you start any command-line session. You can find the settings here:
 
HKLM\Software\Microsoft\Command Processor\AutoRun
HKCU\Software\Microsoft\Command Processor\AutoRun


Tip

If you do not see an AutoRun setting in one or both keys, select the key, select File, New, String Value, type AutoRun, and press Enter.


Tip

The AutoRun Registry settings are handy if you always run a particular command at the beginning of each command-line session. If you run multiple commands to launch a session, you can add those commands to either AutoRun setting. In that case, you must separate each command with the command separator string: &&. For example, to run the IPCONFIG and SET utilities at the start of each command-line session, change the value of an AutoRun setting to the following:

ipconfig&&set


/AConverts the output of internal commands to a pipe or file to the ANSI character set.
/UConverts the output of internal commands to a pipe or file to the Unicode character set.
/T:bfSets the foreground and background colors of the Command Prompt window, where f is the foreground color and b is the background color. Both f and b are hexadecimal digits that specify the color as follows:
 0Black
 1Blue
 2Green
 3Aqua
 4Red
 5Purple
 6Yellow
 7White
 8Gray
 9Light blue
 ALight green
 BLight aqua
 CLight red
 DLight purple
 ELight yellow
 FBright white

Tip

You can also set the foreground and background colors during a command-line session by using the COLOR bf command, where b and f are hexadecimal digits specifying the colors you want. To revert to the default Command Prompt colors, run COLOR without the bf parameter.


/E:ONEnables command extensions, which are extra features added to the following commands. (At the command line, type the command name followed by a space and /? to see the extensions.)
  ASSOCIF
  CALLMD or MKDIR
  CD or CHDIRPOPD
  COLORPROMPT
  DEL or ERASEPUSHD
  ENDLOCALSET
  FORSETLOCAL
  FTYPESHIFT
  GOTOSTART
/E:OFFDisables command extensions.
/F:ONTurns on file and directory name completion, which enables you to press special key combinations to scroll through a list of files or subdirectories in the current directory that match the characters you’ve already typed. For example, suppose that the current directory contains files named budget2006.doc, budget2007.doc, and budget2008.doc. If you type start budget in a command-line session started with /F:ON, pressing Ctrl+F tells Windows 7 to display the first file (or subfolder) in the current folder with a name that starts with budget. Pressing Ctrl+F again displays the next file with a name that starts with budget, and so on. You can do the same thing with just subfolder names by pressing Ctrl+D instead.

Tip

You don’t need to start the Command Prompt with the /F:ON switch to use file and directory name completion. The Command Prompt offers a similar feature called AutoComplete that’s turned on by default. At the prompt, type the first letter or two of a file or subfolder name, and then press the Tab key to see the first object that matches your text in the current folder. Keep pressing Tab to see other matching objects. If, for some reason, you prefer to turn off AutoComplete, pull down the Command Prompt window’s control menu (right-click the title bar), select Defaults, and then deactivate the AutoComplete check box in the Options tab.


/F:OFFTurns off file and directory name completion.
/V:ONEnables delayed environment variable expansion using ! as the delimiter: !var!, where var is an environment variable. This is useful for batch files in which you want to delay the expansion of an environment variable. Normally, Windows 7 expands all environment variables to their current values when it reads the contents of a batch file. With delayed expansion enabled, Windows 7 doesn’t expand a particular environment variable within a batch file until it executes the statement containing that variable.
/V:OFFDisables delayed environment expansion.
/SStrips out the first and last quotation marks from command, provided the first quotation mark is the first character in command.
/CExecutes the command and then terminates.
/KExecutes the command and remains running.
commandThe command to run.
Other -----------------
- Windows Azure : Programming Access Control Service (part 10) - Deploying the Web Service in Windows Azure
- Windows Azure : Programming Access Control Service (part 9) - Configuring a Web Service Client to Acquire and Send SAML Tokens
- Windows Azure : Programming Access Control Service (part 8)
- Windows Azure : Programming Access Control Service (part 7) - Integrating ACS with a SAML Token Provider
- Windows Azure : Programming Access Control Service (part 6)
- Windows Azure : Programming Access Control Service (part 5)
- Windows Azure : Programming Access Control Service (part 4)
- Windows Azure : Programming Access Control Service (part 3)
- Windows Azure : Programming Access Control Service (part 2)
- Windows Azure : Programming Access Control Service (part 1)
- Windows 7 : Working with Registry Entries (part 3)
- Windows 7 : Working with Registry Entries (part 2)
- Windows 7 : Working with Registry Entries (part 1) - Changing the Value of a Registry Entry
- Windows 7 : Keeping the Registry Safe
- Windows 7 : Getting to Know the Registry (part 2)
- Windows 7 : Getting to Know the Registry (part 1) - Understanding Registry Settings
- Windows 7 : Firing Up the Registry Editor
- Windows Azure : Managing Access Control Service Resources (part 2)
- Windows Azure : Managing Access Control Service Resources (part 1)
- Windows Azure : Access Control Service Management Portal
 
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
programming4us programming4us